const askModel = require('./model/askModel');

module.exports.addAskDao = async function (askData) {
    const result = askModel.create(askData);
    return result.dataValues;
}
module.exports.getAskListDao = async function () {
    return await askModel.findAndCountAll();
}
module.exports.updateAskByIdDao = async function (askId, askData) {
    return await askModel.update({
        ...askData
    }, {
        where: {
            id: askId
        }
    })
}
module.exports.getAskByIdDao = async function (askId) {
    return await askModel.findByPk(askId);
}